﻿@section header{
    <title>数据导入</title>
    <link type="text/css" rel="stylesheet" href="/administration/css/site.css" />
    <script type="text/javascript" src="/administration/scripts/jquery.js"></script>
    <script type="text/javascript" src="/administration/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/administration/scripts/jquery.validate.unobtrusive.js"></script>
    <link type="text/css" rel="stylesheet" href="/components/webuploader/webuploader.css" />
    <script type="text/javascript" src="/components/webuploader/webuploader.js"></script>
    <link href="/components/jbox/Skins/Default/jbox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/components/jbox/jquery.jBox-2.3.min.js"></script>
    <script type="text/javascript" src="/administration/scripts/showlist.js"></script>
    <script type="text/javascript">
        $(function () {
            var uploader = WebUploader.create({
                pick: '.uploadBut',
                auto: true,
                swf: '/components/webuploader/Uploader.swf',
                server: '/admin/tool/upload?operation=importdetails',
                fileVal: 'upload',
                accept: {
                    title: 'xls',
                    extensions: 'xls,xlsx',
                    mimeTypes: 'xls/*'
                },
                fileSingleSizeLimit: 10240000
            });

            uploader.on('uploadProgress', function (file, percentage) {
                $(".uploadPreview").html("上传中...");
            });

            uploader.on('uploadSuccess', function (file, response) {
                var data = response._raw;
                if (data == "-1")
                    $(".uploadPreview").html('文件不能为空');
                else if (data == "-2")
                    $(".uploadPreview").html('文件类型不允许');
                else if (data == "-3")
                    $(".uploadPreview").html('文件太大');
                else {
                    //$("#ShowImg").val(data);
                    $(".uploadPreview").html(data);
                }
            });
            uploader.on('uploadError', function (file) {
                $(".uploadPreview").html("上传失败");
            });
        });
    </script>
}
@section body{
    <h1 class="rightH1">
        入库管理 &gt;&gt; 导入
        <div class="right">
             <a href="/0000.xls" class="menuBT">
                <img src="/administration/images/goback.jpg" />下载模板</a>
            <div class="clear">
            </div>
            <a href="@Html.Raw(ViewData["referer"].ToString())" class="menuBT">
                <img src="/administration/images/goback.jpg" />返回列表
            </a>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </h1>
    <div class="table_top">
    </div>

    <div class="table_bottom">
    </div>
    <div class="addTable" style="margin-left: 15px; margin-bottom: 10px; padding-top: 10px;
            border: 2px solid #dbeffa">
        <table width="100%">
            <tbody>
                <tr>
                    <td width="66px" align="right">导入文件：</td>
                    <td>
                        <input type="hidden" name="Pid" id="Pid" value="11" />
                        <div class="upload">
                            <div class="uploadPreview" style="width:180px;">暂无文件</div>
                            <div class="left">
                                <div class="uploadProgressBar"></div>
                                <div class="uploadBut">选择文件</div>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <input type="hidden" name="ShowImg" id="ShowImg" value="" />
                    </td>
                </tr>
                <tr>
                    <td align="right"></td>
                </tr>
            </tbody>
        </table>
    </div>
}
